<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/newAccount.js"></script>
    <script type="text/javascript" src="../js/accountFields.js"></script>
</head>
<body>

<div th:replace="common/top"></div>

<div id="Catalog">
    <form action="register" method="post">

        <h2>用户信息</h2>
        <table id="accountForm">
            <tr>
                <td>账号:</td>
                <td>
                    <input type="text" name="username" id="username"><br/>
                    <span id="msg_username" class="error-msg" th:text="${session.msg_username}"></span>
                    <div id="usernameMsg"></div>
                </td>
            </tr>
            <tr>
                <td>密码:</td>
                <td>
                    <input type="password" name="password" id="password" required="required"><br/>
                    <!--                    <span class="error-msg" th:text="${param.msg_password}"></span>-->
                    <div id="passwordMsg"></div>
                </td>
            </tr>
            <tr>
                <td>再次输入:</td>
                <td>
                    <input type="password" name="repeatedPassword" id="repeatedPassword" required="required"><br/>
                    <!--                    <span class="error-msg" th:text="${msg_repeated_password}"></span>-->
                    <div id="repeatedPasswordMsg"></div>
                </td>
            </tr>
        </table>

        <h2>绑定手机</h2>
        <table>
            <tr>
                <td>电话:</td>
                <td>
                    <input type="text" size="40"
                           name="phone" id="phone" required="required"
                           th:value="${session.account?.phone}"/><br/>
                    <div id="phoneMsg" class="error-msg" style="color: red"
                         th:text="${session.msg_phone}"></div>
                </td>
            </tr>

            <tr>
                <td>验证码:</td>
                <td>
                    <input type="text" size="40"
                           name="code" id="code" required="required"/><br/>
                    <div id="codeMsg" class="error-msg" style="color: red"
                         th:text="${session.msg_code}"></div>
                </td>
                <td>
                    <input type="button" id="send" class="send"
                           formaction="/sendCode1"
                           onclick="return CheckPhone();"
                           value="点击发送"/>
                </td>
            </tr>

            <tr>
                <td>
                    <input type="button" id="checkCode" class="checkCode"
                           formaction="/checkCode"
                           value="确认密保手机"/>
                </td>
            </tr>
        </table>


        <div th:replace="account/accountFields"></div>

        <br>
        <br>
        <input type="submit" name="newAccount" value="确 定"/>
    </form>
</div>
<br>
<br>

<div th:replace="common/bottom"></div>

</body>
</html>